﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace UtilsORM.MySqlData;

/// <summary>
/// 设备
/// </summary>
[Index("lc_d_guid", Name = "idxdguid")]
[Index("lc_vr_guid", Name = "idxdhsguid")]
[Index("lc_guid", Name = "idxlcguid", IsUnique = true)]
[Index("lc_l_guid", Name = "idxlguid")]
[Index("lc_operation", Name = "idxoperation")]
[Index("lc_order", Name = "idxorder")]
[Index("lc_status", Name = "idxstatus")]
[Index("lc_p_model_no", Name = "lc_p_model_no")]
public partial class iot_device_linkage_condition
{
    [Key]
    public long lc_id { get; set; }

    [StringLength(50)]
    public string lc_guid { get; set; }

    /// <summary>
    /// 设备ID
    /// </summary>
    [StringLength(50)]
    public string lc_d_guid { get; set; }

    /// <summary>
    /// 联动类型main,follow
    /// </summary>
    [StringLength(50)]
    public string lc_operation { get; set; }

    /// <summary>
    /// iot_device_command
    /// </summary>
    [StringLength(50)]
    public string lc_dc_guid { get; set; }

    /// <summary>
    /// iot_device_variable
    /// </summary>
    [StringLength(50)]
    public string lc_dv_guid { get; set; }

    /// <summary>
    /// 执行key
    /// </summary>
    [StringLength(50)]
    public string lc_key { get; set; }

    /// <summary>
    /// 执行内容
    /// </summary>
    [Column(TypeName = "text")]
    public string lc_value { get; set; }

    /// <summary>
    /// 执行内容规则,大于，小于，等于&gt;&lt;=
    /// </summary>
    [StringLength(100)]
    public string lc_value_rule { get; set; }

    /// <summary>
    /// 网关ID
    /// </summary>
    [StringLength(50)]
    public string lc_vr_guid { get; set; }

    /// <summary>
    /// 组
    /// </summary>
    [StringLength(50)]
    public string lc_group1 { get; set; }

    /// <summary>
    /// 绑定iot_device_linkage
    /// </summary>
    [StringLength(50)]
    public string lc_l_guid { get; set; }

    /// <summary>
    /// 0启用，1禁用
    /// </summary>
    public int lc_status { get; set; }

    [Column(TypeName = "datetime")]
    public DateTime? lc_add_time { get; set; }

    /// <summary>
    /// 状态修改时间
    /// </summary>
    [Column(TypeName = "datetime")]
    public DateTime? lc_status_modtime { get; set; }

    [Column(TypeName = "datetime")]
    public DateTime? lc_mod_time { get; set; }

    /// <summary>
    /// 执行排序
    /// </summary>
    public int lc_order { get; set; }

    /// <summary>
    /// 产品型号编码
    /// </summary>
    public int? lc_p_model_no { get; set; }

    /// <summary>
    /// 运行重复次数
    /// </summary>
    public int? lc_repeat_count { get; set; }

    /// <summary>
    /// 每隔秒执行一次
    /// </summary>
    public int? lc_repeat_interval { get; set; }
}
